﻿@model dynamic
@{
    Style.Require("prettyPhoto");
    Style.Require("prettyGallery");
    Script.Require("jQuery").AtHead();
    Script.Require("prettyPhoto").AtHead();
}
@using (Script.Foot()) {
<script type="text/javascript">
    //<![CDATA[
    $(document).ready(function () {
        $("a[rel^='prettyPhoto']").prettyPhoto(@(new HtmlString((string)(Model.VM.PrettyParameters))));
    });
    

    $("#pop").on("click", function () {
        $('#imagepreview').attr('src', $('#imageresource').attr('src')); // here asign the image to the modal when the user click the enlarge link
        $('#imagemodal').modal('show'); // imagemodal is the id attribute assigned to the bootstrap modal, then i use the show function
    });
    //]]>
</script>
}

@section Footer {
    <script type="text/javascript">alert("hello everyone");</script>
}

@{Html.RenderPartial((string)Model.VM.Layout, ((PrettyGallery.ViewModels.ViewPrettyGalleryViewModel)(Model.VM)));}

<!-- Creates the bootstrap modal where the image will appear -->
<div class="modal fade" id="imagemodal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <!--<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>-->
        <h4 class="modal-title" id="myModalLabel">Imagen</h4>
      </div>
      <div class="modal-body">
        <img src="" id="imagepreview"> <!-- style="width: 400px; height: 264px;" -->
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div>
  </div>
</div>